package cn.wp.ewallet.common.scheduler;

import cn.wp.common.core.plugin.scheduler.SchedulerRunnable;
import cn.wp.common.core.plugin.scheduler.SchedulerService;
import cn.wp.common.core.plugin.scheduler.SchedulerTask;
import cn.wp.common.core.util.ApplicationContextUtil;


/**
 * @Description 定时报表发送
 * @Author chenyb
 * @Date 2019/11/19 15:20
 **/

public class SchedulerReportRunnable extends SchedulerRunnable {

    private String time;

    public SchedulerReportRunnable(SchedulerTask schedulerTask,String time) {
        super(schedulerTask);
        this.time = time;
    }

    @Override
    public void runStart() {
        // cron : 0 0 8 * * ?
        logger.info("定时器报表邮件发送");
        SchedulerService schedulerService = ApplicationContextUtil.getBean(SchedulerService.class);
        schedulerService.sendReportEmail("PPA",time);
    }

    @Override
    public void runFinish(SchedulerTask schedulerTask) {
        logger.info("定时器报表邮件发送完成");
    }

}
